﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Data.Mapping {
    public partial class ProductActivityMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<ProductActivity> {
        public ProductActivityMap() {
            ToTable("mc_ProductActivity", "dbo");

            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();

            Property(t => t.ActivityRedDrill)
              .HasPrecision(18, 6)
              .IsRequired();

            HasRequired(t => t.Activity)
                .WithMany()
                .HasForeignKey(d => d.ActivityId)
                .WillCascadeOnDelete(false);

            HasRequired(t => t.Product)
                .WithMany()
                .HasForeignKey(d => d.ProductId)
                .WillCascadeOnDelete(false);

            HasRequired(t => t.ProductSku)
                .WithMany()
                .HasForeignKey(d => d.ProductSkuId)
                .WillCascadeOnDelete(false);

        }
    }
}
